<?php
set_time_limit(0);
if (isset($_POST['op']) && isset($_POST['tm'])){
    include '../c/config.php';
    $openid=$_POST['op'];
    $phone=trim(addslashes($_POST['ph']));
    
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    $zu=trim(addslashes($_POST['zu'])); 
    if ('zhong' == $zu) {
    	$tableName='pan_z';
    }else{
        $tableName='pan';
    }
     
      
    $mysqli->query("INSERT INTO `".$tableName."` (`id`, `uid`, `phone`,`zu`, `yhtj`,`createtime`) VALUES (NULL,'".$openid."','".$phone."','".$zu."', '".json_encode($_POST['tm'], JSON_UNESCAPED_UNICODE)."', '".date("Y-m-d H:i:s")."')");
    $mysqli->close();
    echo json_encode(array('s'=>'y'));
}else{
    echo json_encode(array('s'=>'n'));
}

?>